package com.xyw.his00.pojo.dbpojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xyw.his00.pojo.newpojo.ExportPdfFileTemplate;
import com.xyw.his00.service.newservice.ExportPdf;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

//挂号表
@TableName("register")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Register  {
    @TableId(value="id",type=IdType.AUTO)

    private Integer id;
    @NotNull(message = "病历号不能为空")
    @Size(min = 1, max = 50, message = "病历号长度必须在1到50之间")
    private String caseNumber;//病历号

    @NotNull(message = "真实姓名不能为空")
    @Size(min = 1, max = 100, message = "真实姓名长度必须在1到100之间")
    private String realName;//真实姓名
    private String gender;
    @NotNull(message = "身份证号不能为空")
    @Size(min = 18, max = 18, message = "身份证号必须是18位")
    @Pattern(regexp = "^\\d{18}$", message = "身份证号必须是18位数字")
    private String cardNumber;//身份证号
    @NotNull(message = "生日不能为空")
    private LocalDate birthday;
    @NotNull(message = "年龄不能为空")
    private Integer age;
    @NotNull(message = "年龄类型不能为空")
    private String ageType;
    @NotNull(message = "地址不能为空")
   // @Pattern(regexp = "^\{'省'}[1] $")
    private String homeAddress;
    @NotNull(message = "就诊日期不能为空")
    private LocalDateTime visitDate;
    @NotNull(message = "午别不能为空")
    private String noon;
    @NotNull(message = "部门id不能为空")
    private Integer deptmentId;
    @NotNull(message = "医生id不能为空")
    private Integer employeeId;
    @NotNull(message = "挂号医生级别不能为空")
    private Integer registLevelId;
    @NotNull(message = "处置id不能为空")
    private Integer settleCategoryId;
    @NotNull(message = "需不需要病历本不能为空")
    private String isBook;
    @NotNull(message = "收费方式不能为空")
    private String registMethod;
    @NotNull(message = "状态不能为空")
    private Integer visitState;
    @NotNull(message = "实付金额不能为空")
    private BigDecimal registMoney;//?是否能和decimal数据库字段对应

    public Register( String caseNumber, String realName, String gender, String cardNumber, LocalDate birthday, Integer age, String ageType, String homeAddress, LocalDateTime visitDate, String noon, Integer deptmentId, Integer employeeId, Integer registLevelId, Integer settleCategoryId, String isBook, String registMethod, Integer visitState, BigDecimal registMoney) {

        this.caseNumber = caseNumber;
        this.realName = realName;
        this.gender = gender;
        this.cardNumber = cardNumber;
        this.birthday = birthday;
        this.age = age;
        this.ageType = ageType;
        this.homeAddress = homeAddress;
        this.visitDate = visitDate;
        this.noon = noon;
        this.deptmentId = deptmentId;
        this.employeeId = employeeId;
        this.registLevelId = registLevelId;
        this.settleCategoryId = settleCategoryId;
        this.isBook = isBook;
        this.registMethod = registMethod;
        this.visitState = visitState;
        this.registMoney = registMoney;
    }


}
